﻿Public Class Site
    Inherits System.Web.UI.MasterPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If String.IsNullOrEmpty(Session("UserId")) Or String.IsNullOrWhiteSpace(Session("UserId")) Then
            lnkLogin.Visible = True
            lnkReg.Visible = True
            lnkLogOut.Visible = False
            lbUserName.Visible = False
        Else
            lnkLogin.Visible = False
            lnkReg.Visible = False
            lnkLogOut.Visible = True
            lbUserName.Visible = True
            lbUserName.Text = Session("EmailId").ToString()
        End If
    End Sub

    Protected Sub lnkLogin_Click(sender As Object, e As EventArgs) Handles lnkLogin.Click
        Response.Redirect("Login.aspx")
    End Sub

    Protected Sub lnkLogOut_Click(sender As Object, e As EventArgs) Handles lnkLogOut.Click
        Session.RemoveAll()
        Response.Redirect("Default.aspx")
    End Sub

    Protected Sub lnkReg_Click(sender As Object, e As EventArgs) Handles lnkReg.Click
        Response.Redirect("Resgister.aspx")
    End Sub
End Class